package icasue.tools.sqlhelper.core.providers;

import icasue.reflect.annotations.NotNull;
import icasue.tools.sqlhelper.core.Consult;

/**
 * @Author: Qiao Hang
 * @CreateDate: 2021/11/18 下午4:34
 * @UpdateDate:
 * @Description:
 */
public interface UpdateSqlProvider<JavaType extends Object> {
    /**
     * 通过主键匹配修改，修改所有列(除主键/联合主键).
     * @return
     */
    String updateByPrimary(@NotNull JavaType inst) throws Throwable;

    /**
     * 通过主键匹配修改，修改不为null的列(除主键/联合主键).
     * @return
     */
    String updateSmartByPrimary(@NotNull JavaType inst) throws Throwable;


    /**
     * 通过咨询修改，修改所有列(除主键/联合主键).
     * @return
     */
    String updateByConsult(@NotNull JavaType inst,@NotNull Consult<JavaType> consult) throws Throwable;


    /**
     * 通过咨询修改，修改不为null的列(除主键/联合主键).
     * @return
     */
    String updateSmartByConsult(@NotNull JavaType inst, @NotNull Consult<JavaType> consult) throws Throwable;
}
